using SalesPages.DomainModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class SchoolPromotionMap : EntityTypeConfiguration<SchoolPromotion>
    {
        public SchoolPromotionMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.schoolname)
                .HasMaxLength(50);

            this.Property(t => t.text)
                .HasMaxLength(200);

            this.Property(t => t.image)
                .HasMaxLength(50);

            this.Property(t => t.isshow)
                .IsFixedLength()
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("SchoolPromotion");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.schoolname).HasColumnName("schoolname");
            this.Property(t => t.text).HasColumnName("text");
            this.Property(t => t.image).HasColumnName("image");
            this.Property(t => t.startdate).HasColumnName("startdate");
            this.Property(t => t.enddate).HasColumnName("enddate");
            this.Property(t => t.isshow).HasColumnName("isshow");
            this.Property(t => t.lastupdate).HasColumnName("lastupdate");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
        }
    }
}
